package com.island.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.island.model.Action;
import com.pollexsoft.base.dao.BaseHibernateDao;

@Repository
public class ActionDao extends  BaseHibernateDao<Action, java.lang.String> {

	/**
	 * 查询全部权限
	 * @return
	 */
	public List<Action> findAll(){
		return find("from Action", new Object[]{});
	}
	
	/**
	 * 新建一个权限
	 * @param Action
	 */
	public void insertAction(Action action){
		this.insert(action);
	}
	
	/**
	 * 根据ID删除
	 * @param id
	 */
	public void delAction(int id){
		this.delete("delete from Action where actionID=?", id);
	}
	
	/**
	 * 修改权限信息
	 * @param Action
	 */
	public void updateAction(Action action){
		this.update(action);
	}
}
